package cz.acies.data.persist;

import java.util.Map;

public class UserLogin extends ModelObject
{
	private static final long serialVersionUID = 6922321827705300971L;
	
	private String userName;
	private String userPassword;
	private UserPerson person;
	private String mail;
	
	private boolean extension;
	
	public UserLogin() {
		this(null, null);
	}

	public UserLogin(String id) {
		this(id, null);
	}
	
	public UserLogin(String id, Map<String, Object> data) {
		super(id, data);
		/*
		if (this.data.containsKey("userName")) {
			this.setUserName(""+this.data.get("userName")); 
		}
		if (this.data.containsKey("userPassword")) {
			this.setUserPassword(""+this.data.get("userPassword")); 
		}
		*/
	}

	// -----  -----------------------------------------------------------------
		
	public String getUserName() {
		return (String) getValidObject(userName, "userName");
		//return this.userName;
	}

	public void setUserName(String userName) {
		setValidObject(this.userName, userName, "userName");
		this.userName = userName;
	}

	public String getUserPassword() {
		return (String) getValidObject(userPassword, "userPassword");
		//return this.userPassword;
	}

	public void setUserPassword(String password) {
		setValidObject(this.userPassword, password, "userPassword");
		this.userPassword = password;
	}

	public Person getPerson() {
		return (Person) getValidObject(person, "person");
	}

	public void setPerson(Person person) {
		setValidObject(this.person, person, "person");
	}

	public void setPerson(UserPerson person) {
		this.person = person;
	}
	
	public String getMail() {
		return mail;
	}

	public void setMail(String mail) {
		this.mail = mail;
	}

	public boolean isExtension() {
		return extension;
	}

	public void setExtension(boolean extension) {
		this.extension = extension;
	}

}
